import application from "./application.js"; // 应用管理模块 及 编辑文档模块
import dataAnalysis from "./dataAnalysis.js"; // 数据分析模块

const err_404 = {
	path: "*",
	name: "notFound",
	component: () => import(/* webpackChunkName: "404" */ "../views/err/404")
};

export const routes = [
	/*{
		path: "/test",
		name: "test",
		meta: {
			title: "测试",
			icon: "el-icon-s-home",
			parentName: "test"
		},
		component: () => import(/!* webpackChunkName: "home" *!/ "../views/test/index")
	},*/
	{
		path: "/",
		name: "home",
		meta: {
			title: "首页",
			icon: "el-icon-s-home",
			parentName: "home"
		},
		component: () => import(/* webpackChunkName: "home" */ "../views/home/index")
	},
	{
		path: "/buryNeed",
		name: "buryNeed",
		meta: {
			title: "埋点需求",
			icon: "el-icon-document"
		},
		redirect: '/buryNeed/list',
		component: () =>
			import(/* webpackChunkName: "needIndex" */ "../views/buryNeed/index"),
		children: [
			{
				path: "list",
				name: "needList",
				meta: {
					title: "埋点需求",
					parentName: "buryNeed"
				},
				component: () =>
					import(/* webpackChunkName: "needList" */ "../views/buryNeed/list")
			},
			{
				path: "detail/:id",
				name: "needDetail",
				meta: {
					title: "需求详情",
					parentName: "buryNeed"
				},
				component: () =>
					import(/* webpackChunkName: "needDetail" */ "../views/buryNeed/detail")
			},
			{
				path: "edit/:id",
				name: "needEdit",
				meta: {
					title: "编辑需求",
					parentName: "buryNeed"
				},
				component: () =>
					import(/* webpackChunkName: "needEdit" */ "../views/buryNeed/edit")
			},
			/*
      * 需求id
      * 位置埋点id
      * */
			{
				path: "edit/:id/item",
				name: "needItem",
				meta: {
					title: "编辑需求点",
					parentName: "buryNeed"
				},
				component: () =>
					import(/* webpackChunkName: "needItem" */ "../views/buryNeed/item")
			},
			{
				path: "edit/:id/item/:pageDbId",
				name: "needItemPage",
				meta: {
					title: "编辑需求点",
					parentName: "buryNeed"
				},
				component: () =>
					import(/* webpackChunkName: "needItemPage" */ "../views/buryNeed/item")
			},
		]
	},
	{
		path: "/buryDevelop",
		name: "buryDevelop",
		meta: {
			title: "埋点开发",
			icon: "el-icon-cluster",
		},
		redirect: '/buryDevelop/list',
		component: () =>
			import(/* webpackChunkName: "developIndex" */ "../views/buryDevelop/index"),
		children: [
			{
				path: "list",
				name: "developList",
				meta: {
					title: "埋点开发",
					parentName: "buryDevelop"
				},
				component: () =>
					import(/* webpackChunkName: "developList" */ "../views/buryDevelop/list")
			},
			{
				path: ":type/:id",
				name: "developEdit",
				meta: {
					title: "实施埋点",
					parentName: "buryDevelop"
				},
				component: () =>
					import(/* webpackChunkName: "developEdit" */ "../views/buryDevelop/edit")
			},
		]
	},
	{
		path: "/buryMonitor",
		name: "buryMonitor",
		meta: {
			title: "埋点监控",
			icon: "el-icon-monitor",
		},
		redirect: '/buryMonitor/list',
		component: () =>
			import(/* webpackChunkName: "monitorIndex" */ "../views/buryMonitor/index"),
		children: [
			{
				path: "list",
				meta: {
					title: "埋点监控",
					parentName: "buryMonitor"
				},
				name: "monitorList",
				component: () =>
					import(/* webpackChunkName: "monitorList" */ "../views/buryMonitor/list")
			},
			{
				path: "businessDetail/:type/:id",
				meta: {
					title: "栏目详情",
					parentName: "buryMonitor"
				},
				name: "businessDetail",
				component: () =>
					import(/* webpackChunkName: "businessDetail" */ "../views/buryMonitor/businessDetail")
			},
		]
	},
	dataAnalysis,
	err_404
];

export const iconRoutes = [
	{
		path: "/helps",
		name: "helps",
		meta: {
			title: "帮助文档",
			icon: "el-icon-question",
		},
		component: () =>
			import(/* webpackChunkName: "helps" */ "../views/helps/index")
	},
	application.application_obj,
	application.edit_obj
];

